package com.cp.admin.api.entity;

/**
 * @Description ：
 * @Author ： 解风
 * @Date ： 2017/09/13 17:21
 */
public enum CodeEnum {

    SUCCESS(0, "成功！"),
    FAIL(1, "失败！"),
    USER_LOGIN_ERROR_2(2, "手机号未注册"),
    USER_LOGIN_ERROR_3(3, "账号或密码错误"),
    USER_LOGIN_ERROR_4(4, "验证码错误"),
    USER_LOGIN_ERROR_5(5, "手机号已注册"),
    USER_LOGIN_ERROR_6(6, "手机号不正确"),


    FILEDIR_10(10,"head_img/"),
    FILEDIR_11(11,"user_photo/"),

    FAIL_10001(10001, "请求参数无效"),
    FAIL_10002(10002, "文件上传错误，请联系管理员！"),
    FAIL_10003(10003, "用户被冻结！"),
    FAIL_10004(10004, "操作异常，请联系管理员！"),
    FAIL_10005(10005, "相册不存在！"),
    FAIL_10006(10006, "照片已丢失！"),
    FAIL_10007(10007, "用户不存在！"),
    FAIL_10008(10008, "金额有误！"),
    FAIL_10009(10009, "订单提交失败！"),
    FAIL_10010(10010, "订单不存在！"),
    FAIL_10011(10011, "邀请码无效！"),
    FAIL_10012(10012, "图片保存失败，请重新上传！"),
    FAIL_10013(10013, "不能重复登录！"),
    FAIL_10014(10014, "您没有权限查看该相册！"),
    FAIL_10015(10015, "出错，请刷新相册！"),
    FAIL_10016(10016, "余额不足！"),


    FAIL_20001(20001, "未充值vip！"),
    FAIL_20002(20002, "vip已过期！"),
    FAIL_20003(20003, "领取豌豆失败！"),
    FAIL_20004(20004, "不能重复领取！"),
    FAIL_20005(20004, "没有vip权限！"),


    FAIL_30001(30001, "对方账号不存在或异常！"),
    FAIL_30002(30002, "该申请不存在！"),
    FAIL_40001(40001, "没有这个分组！"),
    FAIL_40002(40002, "该分组名已存在！"),
    FAIL_40003(40003, "该申请无效！"),
    FAIL_40004(40004, "该用户已不是您的好友！"),
    FAIL_40005(40005, "该群已解散！"),
    ;
    private int code;
    private String msg;

    CodeEnum(int code, String msg){
        this.code = code;
        this.msg = msg;
    }
    public static Boolean isSuccess(int code){

        return SUCCESS.getCode()==code;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
